package cn.com.chengmandian.service.erp.constants;

/**
 * Description: cmd-erp-center
 * <p>审批模板控件
 * Created by asus on 2022/3/10 12:50
 */
public enum OaProcessModelEnum {
    TEXT_FIELD("TextField","单行输入框"),
    TEXTAREA_FIELD("TextareaField","多行输入框"),
    NUMBER_FIELD("NumberField","数字输入框"),
    DD_SELECT_FIELD("DDSelectField","单选框"),
    DD_MULTI_SELECT_FIELD("DDMultiSelectField","多选框"),
    DD_DATE_FIELD("DDDateField","日期控件"),
    DD_DATE_RANGE_FIELD("DDDateRangeField","时间区间控件"),
    TEXT_NOTE("TextNote","文字说明控件"),
    PHONE_FIELD("PhoneField","电话控件"),
    DD_PHOTO_FIELD("DDPhotoField","图片控件"),
    MONEY_FIELD("MoneyField","金额控件"),
    TABLE_FIELD("TableField","明细控件"),
    DD_ATTACHMENT("DDAttachment","附件"),
    INNER_CONTACT_FIELD("InnerContactField","联系人控件"),
    DEPARTMENT_FIELD("DepartmentField","部门控件"),
    RELATE_FIELD("RelateField","关联审批单"),
    ADDRESS_FIELD("AddressField","省市区控件"),
    STAR_RATING_FIELD("StarRatingField","评分控件"),
    FORM_RELATE_FIELD("FormRelateField","关联控件");

    private String code;

    private String name;

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static OaProcessModelEnum getNameByCode(String code){
        if(code == null){
            return null;
        }else{
            OaProcessModelEnum[] values = values();
            for(OaProcessModelEnum oaProcessModel :values){
                if(oaProcessModel.getCode().equals(code)){
                    return oaProcessModel;
                }
            }
        }
        return null;
    }

    OaProcessModelEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }
}
